<template>
  <div>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" :editFormFileds="editFormFields" :editFormOptions="editFormOptions"
      :searchFormFields="searchFormFields" :searchFormFileds="searchFormFields" :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
    </view-grid>
  </div>
</template>
<script>
import extend from '@/extension/mall/small_user_archives.js'
import ViewGrid from '@/components/basic/ViewGrid.vue'

var vueParam = {
  components: {
    ViewGrid,
  },
  data() {
    return {
      table: {
        key: 'id',
        footer: 'Foots',
        cnName: '档案信息',
        name: 'small_user_archives',
        url: '/SmallUserArchives/',
        sortName: 'id',
      },
      extend: extend,
      editFormFields: {
        name: '',
        phone: '',
        sex: '',
        certificate_type: '',
        id_card: '',
        open_id: '',
        head_img: '',
        nickname: '',
        photo: '',
        Invite_code: '',
        nationality: '',
        countries: '',
        province: '',
        password: '',
        city: '',
        area: '',
        note: '',
        distributors_id: '',
        modifier: '',
        modifyDate: '',
        createDate: '',
        createID: '',
        modifyID: '',
        creator: '',
      },
      editFormOptions: [
        [
          { title: '照片', field: 'address', type: 'imgupgrade' },
          { title: '姓名', required: true, field: 'name', type: 'text' },
          { title: '性别', required: true, field: 'sex', type: 'drop', dataKey: 'gender' },
        ],
        [
          { title: '证件类型', required: true, field: 'certificate_type', type: 'select', dataKey: 'certificate_type', data: [] },
          { title: '证件号', required: true, field: 'id_card', type: 'text' },
          { title: '电话', required: true, field: 'phone', type: 'phone' },
        ],
        [
          { title: '国籍', field: 'nationality', type: 'select', dataKey: '', data: [] },
          { title: '国家', field: 'countries', type: 'select', dataKey: '', data: [] },
          { title: '分销商', field: 'distributorCode', type: 'select', dataKey: 'distributorList', data: [] },
        ],
        [
          { title: '会员类型', field: 'address', type: 'text' },
          { title: '会员等级', field: 'address', type: 'text' },
          { title: '会员有效期', field: 'address', type: 'text' },
        ],
        [
          { title: '地址', field: 'address', type: 'select', dataKey: '', data: [] },
          { title: '详细地址', field: 'address', type: 'text' },
        ],
      ],
      // editFormOptions: [
      //                  [
      //                  {"title":"姓名","required":true,"field":"name","type":"text"},
      //                  {"title":"性别","required":true,"field":"sex","type":"drop","dataKey":"gender"}],
      //                 [{"title":"证件类型","required":true,"field":"certificate_type","type":"select",dataKey:"certificate_type",data:[]},
      //                 {"title":"证件号","required":true,"field":"id_card","type":"text"},
      //                 {"title":"电话","required":true,"field":"phone","type":"phone"}],
      //                 [{"title":"国籍","field":"nationality","type":"select",dataKey:"",data:[]},
      //                  {"title":"国家","field":"countries","type":"select",dataKey:"",data:[]},
      //                  {"title":"分销商","field":"distributorCode","type":"select",dataKey:"distributorList",data:[]}],
      //                  [{"title":"地址","field":"address","type":"select",dataKey:"",data:[]}]
      //                 ],
      searchFormFields: { name: '', nickname: '', id_card: '', phone: '', nationality: '', sex: '' },
      searchFormOptions: [
        [
          { title: '姓名', field: 'name', type: 'like' },
          { title: '昵称', field: 'nickname', type: 'like' },
          { title: '证件号', field: 'id_card', type: 'like' },
        ],
        [
          { title: '电话', field: 'phone', type: 'like' },
          { title: '国籍', field: 'nationality', type: 'like' },
        ],
      ],
      columns: [
        { field: 'id', title: '主键', type: 'string', width: 120, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'name', title: '姓名', type: 'string', width: 120, align: 'left' },
        { field: 'photo', title: '照片', type: 'img', width: 120, align: 'left' },
        { field: 'head_img', title: '头像', type: 'img', width: 120, align: 'left' },
        { field: 'nickname', title: '昵称', type: 'string', width: 120, align: 'left' },
        { field: 'sex', title: '性别', bind: { key: 'gender', data: [] }, type: 'string', width: 120, align: 'left' },
        { field: 'phone', title: '电话', type: 'string', width: 120, align: 'left' },
        //{field:'status',title:'状态',type:'string',width:120,align:'left'},
        // {field:'password',title:'密码',type:'string',width:120,align:'left'},
        { field: 'certificate_type', title: '证件类型', bind: { key: 'certificate_type', data: [] }, type: 'string', width: 120, align: 'left' },
        { field: 'id_card', title: '证件号', type: 'string', width: 180, align: 'left' },
        // {field:'open_id',title:'openID',type:'string',width:120,align:'left'},
        { field: 'note', title: '备注', type: 'string', width: 120, align: 'left' },
        { field: 'nationality', title: '国籍', type: 'string', width: 120, align: 'left' },
        { field: 'countries', title: '国家', type: 'string', width: 120, align: 'left' },
        // {field:'province',title:'省',type:'string',width:120,align:'left'},
        // {field:'city',title:'市',type:'string',width:120,align:'left'},
        //  {field:'area',title:'区',type:'string',width:120,align:'left'},
        { field: 'address', title: '地址', type: 'string', width: 120, align: 'left' },
      ],
      detail: {
        cnName: '会员联系人',
        columns: [],
        sortName: '',
        key: '',
      },
    }
  },
}
export default vueParam
</script>